﻿using FluentValidation;
using Nop.Web.Models.Install;

namespace Nop.Web.Validators.Install
{
    public class InstallValidator : AbstractValidator<InstallModel>
    {
        public InstallValidator()
        {
            RuleFor(x => x.AdminEmail).NotEmpty().WithMessage("输入管理员邮箱");
            RuleFor(x => x.AdminEmail).EmailAddress();
            RuleFor(x => x.AdminPassword).NotEmpty().WithMessage("输入管理员密码");
            RuleFor(x => x.ConfirmPassword).NotEmpty().WithMessage("输入确认密码");
            RuleFor(x => x.AdminPassword).Equal(x => x.ConfirmPassword).WithMessage("密码不匹配");
            RuleFor(x => x.DataProvider).NotEmpty().WithMessage("请选择数据库方式");
            
        }}
}